<?php if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('index');?><?php include template('common/header'); ?><div id="wp" class="wp">
    <div id="pt" class="bm cl">
        <div class="z">
            <a href="./" class="nvhm" title="首页">中国自行车在线</a> <em>›</em>
            <a href="plugin.php?id=dzapp_zhibo">直播</a> <em>›</em>
            <a href="plugin.php?id=dzapp_zhibo&amp;mod=zhibocp">管理中心</a> <em>›</em>
            <a href="plugin.php?id=dzapp_zhibo&amp;mod=zhibocp&amp;ac=activity">活动</a> <em>›</em>
        </div>
    </div>
    <div id="ct" class="ct2_a wp cl">
        <div class="mn">
            <div class="bm bw0">
                <ul class="tb mbm cl">
                    <li class="a"><a href="plugin.php?id=dzapp_zhibo&amp;mod=zhibocp&amp;ac=activity">活动</a></li>
                    <li class="o y"><a href="plugin.php?id=zhibo&amp;ac=activity">添加活动</a></li>
                    <li class="y">
                        <form method="post"
                              action="plugin.php?id=dzapp_zhibo&amp;mod=zhibocp&amp;ac=activity&amp;op=list">
                            名称:
                            <input type="text" name="name" value="" style="width:80px">
                            状态:
                            <select name="end">
                                <option value="0" selected="selected">未结束</option>
                                <option value="3">已结束</option>
                                <option value="-1" selected="selected">全部</option>
                            </select>
                            <button type="submit" class="pn pnp"><strong>搜索</strong></button>
                        </form>
                    </li>
                </ul>

                <form name="cateform" method="post" action="plugin.php?id=zhibo&amp;ac=activity&amp;op=del">
                    <!--<input type="hidden" name="formhash" value="6c4dff8c">-->
                    <!--<input type="hidden" name="listsubmit" value="true">-->
                    <table cellspacing="0" cellpadding="0" class="dt mtm" id="table1">
                        <tbody>
                        <tr class="th">
                            <th width="20"></th>
                            <th width="100">直播名称</th>
                            <th width="100">开始时间</th>
                            <th width="70">结束时间</th>
                            <th width="70">推流地址</th>
                            <th width="100">直播地址</th>
                            <th width="100">直播管理员</th>
                            <th width="100">状态</th>
                            <th width="100"></th>
                            <th width="100"></th>
                        </tr>
                        <style type="text/css">
                            a.qrcode {
                                position: relative;
                                display: block;
                            }

                            a.qrcode:hover {
                                color: #FF3366
                            }

                            a.qrcode span {
                                display: none;
                                position: absolute;
                                right: -180px;
                                top: -80px;
                                box-shadow: 0 0 10px #e2e2e2;
                            }

                            a.qrcode:hover span {
                                display: block;
                            }

                            td em {
                                color: #A70A2E;
                            }
                        </style>
                        <?php if(is_array($data)) foreach($data as $key => $val) { ?>                        <tr>
                            <td><input type="checkbox" name="delete[]" class="pc" value="<?php echo $val['id'];?>"></td>
                            <td>
                                <a href="plugin.php?id=zhibo&amp;ac=activity&amp;op=view&amp;identify=<?php echo $val['id'];?>" target="_blank" class="qrcode"><?php echo $val['channelName'];?>
                                <span>
                                    <input type="text" placeholder="">
                                    <img src="http://www.liantu.com/images/2013/liantu.png">
                                    <!--<img src="http://qr.liantu.com/api.php?w=180&amp;m=10&amp;el=h&amp;fg=495662&amp;text=http%3A%2F%2Fwww.olbike.com%2Fplugin.php%3Fid%3Ddzapp_zhibo%26mod%3Dview%26identify%3D3">-->
                                </span>
                                </a>
                            </td>
                            <td style="color:#999"><?php echo $val['start'];?></td>
                            <td style="color:#999"><?php echo $val['end'];?></td>
                            <td width="360px" style="color:#999;word-break:break-all"><?php echo $val['downstream_address']['0']['rtmp_downstream_address'];?></td>
                            <td style="color:#999">http://www.olbike.com</td>
                            <td style="color:#999"><?php echo $val['username'];?></td>
                            <td id="status" style="color:#999">
                                <?php if($val['channel_status'] == 0) { ?>
                                无输出流
                                <?php } elseif($val['channel_status'] == 1) { ?>
                                直播中
                                <?php } elseif($val['channel_status'] == 2) { ?>
                                异常
                                <?php } elseif($val['channel_status'] == 3) { ?>
                                关闭
                                <?php } ?>
                            </td>
                            <td><a class="testLink"  href="plugin.php?id=zhibo&amp;ac=activity&amp;op=edit&amp;activity_id=<?php echo $val['id'];?>">编辑</a></td>

                            <td style="color:#999">管理评论</td>
                        </tr>
                        <?php } ?>

                        <tr class="bw0_all">
                            <td>
                                <input type="checkbox"  id="chkall" class="pc" onclick="checkall(this.form)">
                                <label for="chkall">删?</label>
                            </td>
                            <td colspan="20">
                                <button type="submit" id="test" class="pn">
                                    <strong>提交</strong>
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
        <div class="appl">
            <div class="tbn">
                <h2 class="mt bbda">管理中心</h2>
                <ul id="g1">
                    <li class="a"><a href="plugin.php?id=zhibo">活动</a></li>
                    <li><a href="plugin.php?id=zhibo&amp;ac=gift">礼物</a></li>
                    <li> <button class="testLink">选择</button></li>


                </ul>
            </div>
        </div>
    </div>
</div>
<script>
    OLBIKEjq(function(){
        var trs=OLBIKEjq("#table1 tr");
        OLBIKEjq(".testLink").click(function(event){
            var idTest = trs.index(OLBIKEjq(this).closest("tr"));
            var a = trim((OLBIKEjq("#table1 tr:eq("+idTest+") td:eq(7)").html()));

            if(a == '无输出流' || a == '直播中' || a == '异常'){
                alert('频道处于非编辑状态，请先关闭频道.');
                event.preventDefault();
            }

        });
    });
</script><?php include template('common/footer'); ?>